#include "src/log/log.h"
#include "src/common/Semaphore.h"
#include "src/app/application.h"
#include <string>
#include <stdio.h>

#include <signal.h>

CSemaphore g_Sem;
////信号初始化函数
void sigInit(void){
    struct sigaction sa;
    sa.sa_handler = SIG_IGN;
    sa.sa_flags = 0;
    if(sigemptyset(&sa.sa_mask) == -1 || sigaction(SIGPIPE, &sa , 0) == -1){
        printf("%s%s%d", __FILE__, __FUNCTION__, __LINE__);
        exit(-1);
    }
}
int main(int argc, char *argv[])
{
    sigInit();
    std::shared_ptr<CApplication> app = std::make_shared<CApplication>();
    app->init();
    LOG_INFO("Enter main");
    g_Sem.Wait();
    return 0;
}
